<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * Recepient filter form base class.
 *
 * @package    filters
 * @subpackage Recepient *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseRecepientFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'picture'       => new sfWidgetFormFilterInput(),
      'firstname'     => new sfWidgetFormFilterInput(),
      'middleinitial' => new sfWidgetFormFilterInput(),
      'lastname'      => new sfWidgetFormFilterInput(),
      'age'           => new sfWidgetFormFilterInput(),
      'status'        => new sfWidgetFormChoice(array('choices' => array('' => '', 'S' => 'S', 'W' => 'W', 'M' => 'M'))),
      'purok'         => new sfWidgetFormFilterInput(),
      'barangay'      => new sfWidgetFormFilterInput(),
      'town_id'       => new sfWidgetFormDoctrineChoice(array('model' => 'Town', 'add_empty' => true)),
      'occupation'    => new sfWidgetFormFilterInput(),
      'income'        => new sfWidgetFormFilterInput(),
      'contactno'     => new sfWidgetFormFilterInput(),
      'education'     => new sfWidgetFormFilterInput(),
      'childno'       => new sfWidgetFormFilterInput(),
      'fchildno1'     => new sfWidgetFormFilterInput(),
      'fchildno11'    => new sfWidgetFormFilterInput(),
      'fchildno16'    => new sfWidgetFormFilterInput(),
      'fchildno21'    => new sfWidgetFormFilterInput(),
      'mchildno1'     => new sfWidgetFormFilterInput(),
      'mchildno11'    => new sfWidgetFormFilterInput(),
      'mchildno16'    => new sfWidgetFormFilterInput(),
      'mchildno21'    => new sfWidgetFormFilterInput(),
      'seminars'      => new sfWidgetFormFilterInput(),
      'broiler'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'pig'           => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'goat'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'tilapia'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'chicken'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'swine'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fruits'        => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'vegetables'    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'cash'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'land'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'housing'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'others'        => new sfWidgetFormFilterInput(),
      'charrefs'      => new sfWidgetFormFilterInput(),
      'comments'      => new sfWidgetFormFilterInput(),
      'date'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
    ));

    $this->setValidators(array(
      'picture'       => new sfValidatorPass(array('required' => false)),
      'firstname'     => new sfValidatorPass(array('required' => false)),
      'middleinitial' => new sfValidatorPass(array('required' => false)),
      'lastname'      => new sfValidatorPass(array('required' => false)),
      'age'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'status'        => new sfValidatorChoice(array('required' => false, 'choices' => array('S' => 'S', 'W' => 'W', 'M' => 'M'))),
      'purok'         => new sfValidatorPass(array('required' => false)),
      'barangay'      => new sfValidatorPass(array('required' => false)),
      'town_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Town', 'column' => 'id')),
      'occupation'    => new sfValidatorPass(array('required' => false)),
      'income'        => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'contactno'     => new sfValidatorPass(array('required' => false)),
      'education'     => new sfValidatorPass(array('required' => false)),
      'childno'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fchildno1'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fchildno11'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fchildno16'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fchildno21'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mchildno1'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mchildno11'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mchildno16'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mchildno21'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'seminars'      => new sfValidatorPass(array('required' => false)),
      'broiler'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'pig'           => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'goat'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'tilapia'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'chicken'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'swine'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fruits'        => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'vegetables'    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'cash'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'land'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'housing'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'others'        => new sfValidatorPass(array('required' => false)),
      'charrefs'      => new sfValidatorPass(array('required' => false)),
      'comments'      => new sfValidatorPass(array('required' => false)),
      'date'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('recepient_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Recepient';
  }

  public function getFields()
  {
    return array(
      'id'            => 'Number',
      'picture'       => 'Text',
      'firstname'     => 'Text',
      'middleinitial' => 'Text',
      'lastname'      => 'Text',
      'age'           => 'Number',
      'status'        => 'Enum',
      'purok'         => 'Text',
      'barangay'      => 'Text',
      'town_id'       => 'ForeignKey',
      'occupation'    => 'Text',
      'income'        => 'Number',
      'contactno'     => 'Text',
      'education'     => 'Text',
      'childno'       => 'Number',
      'fchildno1'     => 'Number',
      'fchildno11'    => 'Number',
      'fchildno16'    => 'Number',
      'fchildno21'    => 'Number',
      'mchildno1'     => 'Number',
      'mchildno11'    => 'Number',
      'mchildno16'    => 'Number',
      'mchildno21'    => 'Number',
      'seminars'      => 'Text',
      'broiler'       => 'Boolean',
      'pig'           => 'Boolean',
      'goat'          => 'Boolean',
      'tilapia'       => 'Boolean',
      'chicken'       => 'Boolean',
      'swine'         => 'Boolean',
      'fruits'        => 'Boolean',
      'vegetables'    => 'Boolean',
      'cash'          => 'Boolean',
      'land'          => 'Boolean',
      'housing'       => 'Boolean',
      'others'        => 'Text',
      'charrefs'      => 'Text',
      'comments'      => 'Text',
      'date'          => 'Date',
    );
  }
}